<include file="Public:header" />
<script language="JavaScript">
    ifcheck = true;

    function CheckAll(form) {
        for (var i = 0; i < form.elements.length - 2; i++) {
            var e = form.elements[i];
            e.checked = ifcheck;
        }
        ifcheck = ifcheck == true ? false : true;
    }
</script>
<script language=javascript src="__PUBLIC__/Js/wpCalendar.js"></script>

<div class="accounttitle">
    <h1>产品管理</h1>
</div>
<div class="ncenter_box">
    <form class="navbar-form">
        <table align="center">
        <tr>
          <td colspan="3" style="border: none"><a href="__URL__/pro_tianjia" class="btn1 chanp">产品添加</a>
          <a href="__URL__/cptype_index" class="btn1 fenl">分类管理</a></td>
        </tr>
            <tr>
                <td>搜索产品:</td>
                <td>
                    <input type="text" name="stitle" value="{$stitle}" placeholder="请输入产品名称" style=" border: 1px solid #c1c2c2;padding: 8px 0;text-indent: 15px;border-radius: 5px;">
                    <!-- <input type="text" class="form-control" id="templatemo_search_box" placeholder="请输入产品名称"> -->
                </td>
                <td>
                    <input type="submit"  value="查询" style="padding: 8px 12px; background: #b13a33;color: #fff;border-radius: 5px">
                    <!-- <input type="submit" name="Submit" value="查询" class="ui negative basic mini btn button_text" /> -->
                    <input name="did" type="hidden" id="did" value="{$did}" class="ui negative basic mini btn button_text" />
                </td>
                
            </tr>
        </table>
    </form>
    <form action="__URL__/pro_zz" method="post" name="form3" id="form3">
        <table width="100%" cellpadding=3 border=0 cellspacing="1" id="tb1" bgcolor="#b9c8d0" class="tab3">
            <thead>
                <tr align="center" class="content_td">
                    <th>&nbsp;</th>
                    <th>产品编号</th>
                    <th>商品名称</th>
                    <th>一级分类</th>
                    <th>二级分类</th>
                    <!-- <th>成本</th> -->
                    <th>售价</th>
                    <th>上架时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo">
                    <tr>
                        <td>
                            <input type="checkbox" name="checkbox[]" value="{$vo['id']}">
                        </td>
                        <td>{$vo.cid}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.cptype|cp_name}</td>
                        <td>{$vo.cptype2|cp_name}</td>
                        <!-- <td>{$vo.a_money}</td> -->
                        <td>{$vo.money}</td>
                        <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                        <td><a href="__URL__/pro_edit/EDid/{$vo['id']}" class="btn btn-default">编辑</a></td>
                    </tr>
                </volist>
            </tbody>
            <tr align="center">
                <td colspan="7">
                    <input type="checkbox" name="chkall" value="checkbox" onclick="CheckAll(this.form)" class="btn2" id="chkall" />全选
                    <input type="submit" name="action" value="删除" onClick="return allcheckbox();" class="btn" style="display: inline-block;padding: 2px 15px;">
                </td>

            </tr>
        </table>
    </form>
    <table width="100%" cellpadding=0 cellspacing=1 border=0>
        <tr align="center" class="content_td">
            <td colspan="10">{$page}</td>
        </tr>
    </table>
    <div style="height: 60px;"></div>
</div>



<script type="text/javascript" language="javascript">
function gehang() {
    //获取tr节点
    var tr = document.getElementsByTagName("tr");
    //为第一行添加背景颜色
    tr[0].style.background = "#00FF66";
    //为最后一行添加背景颜色
    tr[tr.length - 1].style.background = "#00FF66";
}
//创建全选反选函数
function xuan(type) {
    //获取name值
    var qcheck = document.getElementsByName("check[]");
    //获取选的按钮
    if (type == "qx") {
        for (var i = 0; i <= qcheck.length; i++) {
            qcheck[i].checked = true;
        }
    }
    if (type == "fx") {
        for (var i = 0; i <= qcheck.length; i++) {
            qcheck[i].checked = false;
        }
    }

    if (type == "qxx") {
        for (var i = 0; i <= qcheck.length; i++) {
            if (qcheck[i].checked) {
                qcheck[i].checked = false;
            } else {
                qcheck[i].checked = true;

            }
        }
    }
}

function del() {
    var input = document.getElementsByName("check[]");
    for (var i = input.length - 1; i >= 0; i--) {
        if (input[i].checked == true) {
            //获取td节点
            var td = input[i].parentNode;
            //获取tr节点
            var tr = td.parentNode;
            //获取table
            var table = tr.parentNode;
            //移除子节点
            table.removeChild(tr);
        }

    }

}
</script>

<include file="Public:footer" />